<?php

namespace Wechat\Listener;

use Hyperf\Di\Annotation\Inject;
use Hyperf\Event\Annotation\Listener;
use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Utils\Pipeline;
use Wechat\Event\WsMessageEvent;


/**
 * @Listener()
 */
class WsMessageListener implements ListenerInterface
{
    public function listen(): array
    {
        return [
            WsMessageEvent::class
        ];
    }

    /**
     * @Inject()
     * @var Pipeline
     */
    protected $pipeline;

    protected $pipes = [];

    public function process(object $event)
    {
        /** @var WsMessageEvent $_event */
        $_event = $event;
        $this->pipeline->send($_event)->through($this->pipes)->then(function (){

        });

    }


}